-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implment Monthly-Checking API Endpoint #172
Conversation
- Moved monthly checking service functions to a dedicated service file (monthlyChecking.service.ts). - Moved monthly checking controller functions to a dedicated controller file (monthlyChecking.controller.ts). - Updated import paths and references to reflect the new file structure. - Improved code organization and maintainability by separating concerns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this 'sudo' empty file
checkIns: Array<{ | ||
uuid: string | ||
title: string | ||
generalUpdatesAndFeedback: string | ||
progressTowardsGoals: string | ||
mediaContentLinks: string[] | ||
mentorFeedback: string | null | ||
isCheckedByMentor: boolean | ||
mentorCheckedDate: Date | null | ||
checkInDate: Date | ||
mentee: Mentee | ||
}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create the CheckIn type at types.ts
const checkInsWithUuid = checkIns.map((checkIn) => ({ | ||
uuid: checkIn.uuid, | ||
title: checkIn.title, | ||
generalUpdatesAndFeedback: checkIn.generalUpdatesAndFeedback, | ||
progressTowardsGoals: checkIn.progressTowardsGoals, | ||
mediaContentLinks: checkIn.mediaContentLinks, | ||
mentorFeedback: checkIn.mentorFeedback, | ||
isCheckedByMentor: checkIn.isCheckedByMentor, | ||
mentorCheckedDate: checkIn.mentorCheckedDate, | ||
checkInDate: checkIn.checkInDate, | ||
mentee: checkIn.mentee | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to map here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! @mayura-andrew
Purpose
The purpose of this PR is to fix #157
Goals
Approach
Implemened controller and service for monthly checking api endpoint
Created a new service file monthlyChecking.service.ts to handle the business logic for monthly checking.
Implemented the addMonthlyCheckIn, fetchMonthlyCheckIns and addFeedbackByMentorfunctions in the service file.
Updated the controller to call the appropriate service functions.
Screenshots
Checklist
Related PRs
Test environment
Os: Linux Mint 21.3
Nodejs: 20.15.0
Learning